const ajax = window.ajaxFlowApi;

/**
 * 员工
 *
 * @param params
 */
// 员工列表
export let employeeList = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/info/list', 'post', params, {
    showLoading: true
  });
};
// 员工新增
export let employeeCreate = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/info', 'post', params, {
    showLoading: true
  });
};
// 员工编辑
export let employeeUpdate = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/info', 'put', params, {
    showLoading: true
  });
};
// 员工删除
export let employeeDelete = (params = {}) => {
  return ajax.request(`/organization/management/employee/info/${params.primaryKey}/${params.enterpriseKey}`, 'delete', {}, {
    showLoading: true
  });
};
// 员工详情
export let employeeDetail = (params = '') => {
  return ajax.request(`/organization/management/employee/info/${params}`, 'get', {}, {
    showLoading: true
  });
};

// 员工列表 党 /v1/business/employee/list
export let staffSearchList = (params = {}) => {
  return ajax.request('/v1/business/employee/list', 'post', params, {
    showLoading: true
  });
};

// 员工列表 党 /v1/business/employee/list
export let staffOaSearchList = (params = {}) => {
  return ajax.request('/v1/business/employee/list', 'post', params, {
    showLoading: true
  }, '/oa-api/v1');
};

// /v1/business/employee  d 员工新增
export let staffCreate = (params = {}) => {
  return ajax.request('/v1/business/employee', 'post', params, {
    showLoading: true
  });
};
// 员工编辑 d /v1/business/employee
export let staffUpdate = (params = {}) => {
  return ajax.request('/v1/business/employee', 'put', params, {
    showLoading: true
  });
};
// d员工删除/v1/business/employee/{primaryKey}
export let staffDelete = (primaryKey) => {
  return ajax.request(`/business/employee/${primaryKey}`, 'delete', {}, {
    showLoading: true
  });
};
export let staffDetail = (primaryKey) => {
  return ajax.request(`/business/employee/${primaryKey}`, 'get', {}, {
    showLoading: true
  });
};
/**
 * 员工家庭
 *
 * @param params
 */
// 家庭成员列表
export let employeeFamilyList = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/family/list', 'post', params, {
    showLoading: true
  });
};
// 家庭成员新增
export let employeeFamilyCreate = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/family', 'post', params, {
    showLoading: true
  });
};
// 家庭成员编辑
export let employeeFamilyUpdate = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/family', 'put', params, {
    showLoading: true
  });
};
// 家庭成员删除
export let employeeFamilyDelete = (params = '') => {
  return ajax.request(`/organization/management/employee/family/${params}`, 'delete', {}, {
    showLoading: true
  });
};


/**
 * 工作经历
 *
 * @param params
 */
// 工作经历列表
export let employeeWorkList = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/work/list', 'post', params, {
    showLoading: true
  });
};
// 工作经历新增
export let employeeWorkCreate = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/work', 'post', params, {
    showLoading: true
  });
};
// 教育经历编辑
export let employeeWorkUpdate = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/work', 'put', params, {
    showLoading: true
  });
};
// 工作经历删除
export let employeeWorkDelete = (params = '') => {
  return ajax.request(`/organization/management/employee/work/${params}`, 'delete', {}, {
    showLoading: true
  });
};

/**
 * 教育经历
 *
 * @param params
 */
// 教育经历列表
export let employeeEduList = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/edu/list', 'post', params, {
    showLoading: true
  });
};
// 教育经历新增
export let employeeEduCreate = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/edu', 'post', params, {
    showLoading: true
  });
};

// 教育经历编辑
export let employeeEduUpdate = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/edu', 'put', params, {
    showLoading: true
  });
};
// 教育经历删除
export let employeeEduDelete = (params = '') => {
  return ajax.request(`/organization/management/employee/edu/${params}`, 'delete', {}, {
    showLoading: true
  });
};


/**
 * 资质证书
 *
 * @param params
 */
// 资质证书列表
export let employeeCertList = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/cert/list', 'post', params, {
    showLoading: true
  });
};
// 资质证书新增
export let employeeCertCreate = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/cert', 'post', params, {
    showLoading: true
  });
};
// 资质证书编辑
export let employeeCertUpdate = (params = {}) => {
  return ajax.request('/v1/organization/management/employee/cert', 'put', params, {
    showLoading: true
  });
};
// 资质证书删除
export let employeeCertDelete = (params = '') => {
  return ajax.request(`/organization/management/employee/cert/${params}`, 'delete', {}, {
    showLoading: true
  });
};

